home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
027a
/
vntx.zip
/
CORRUPT.MAN
< prev
next >
Wrap
Text File
|
1991-02-07
|
4KB
|
133 lines
John T. Opincar, Jr.
CID 71631,541
INTRODUCTION
============
Corrupted() is a function written in Clipper 5.0 (with a little
help from C) which verifies indices. Specifically, corrupted()
checks for two situations. First, corrupted() checks for any
references in the index to a record number greater than
lastrec(). This condition indicates that the database has been
packed without updating the indices. Second, corrupted() checks
for any index entry whose key value does not match the
corresponding record. This condition indicates that the record
was changed while the associated index was not open.
You can use corrupted() in three ways. You can compile and link
VNTX.EXE which is a DOS command line interface to corrupted().
You can also link corrupted() directly into your applications.
Finally, you can modify corrupted(), as complete source code is
provided.
NOTE that corrupted() is written for 5.0. However, you can still
use VNTX.EXE to verify S87 indices.
NOTE also that you must declare any user-defined functions
referenced in your index keys EXTERNAL (see vntx.prg) and then
recompile and relink VNTX.EXE before attempting to verifty any
indices containing such references.
You should have the following files:
corrupt.man This documentation file
corrupt.prg Clipper source code for corrupted()
corrupt.ch Clipper header file for corrupted()
corsupp.c C support for corrupted()
corsupp.obj Object code for the C support file
vntx.prg Cliiper source code for a command line interface
create.bat Batch file which compiles and links VNTX.EXE
createb.bat Creation batch file for use with Blinker
VNTX.EXE
========
VNTX.EXE is a command line interface for corrupted(). The syntax
for invoking VNTX is:
VNTX <database name> <index name>
VNTX will display its results as well as setting ERRORLEVEL. An
ERRORLEVEL of 1 indicates that the index was corrupted. An
ERRORLEVEL of 2 indicates that corrupted() was unable to check
the index for some reason, e.g. the index does not exist. VNTX
will work on both S87 and 5.0 indices.
1
CORRUPTED()
===========
Corrupted() is a Clipper 5.0 function which determines whether or
not an index is corrupted, and if so, how. The syntax for
corrupted() is:
corrupted(<sDbfName>, <sNtxName>, @<nBadRecno>) --> nErrorCode
sDbfName and sNtxName are the names of the database and index
files to check, respectively. nBadRecno is a variable you should
pass by reference. If corrupted() determines that the index is
invalid, then the offending record number will be returned in
this variable. Corrupted() returns the following error codes
defined in corrupt.ch:
Result Value Corrupt.ch
=================================================================
Record number out of bounds 2 CO_BADRECNO
Key mismatch 1 CO_BADKEY
No Problems 0 CO_OK
Unable to open index file -1 CO_NTXOPEN
Unable to read index file -2 CO_NTXREAD
Unable to find database file -3 CO_BADDBF
Index key is not defined -4 CO_KEYUNDEFINED
See vntx.prg for an example of how to use corrupted().
2